/*
 * @Descripttion: 
 * @version: 
 * @Author: Jun
 * @Date: 2021-06-04 16:45:49
 * @LastEditors: Jun
 * @LastEditTime: 2021-06-04 16:46:14
 */
export const setFormOptions = (formArray) => {
    //给公共表单、特殊表单都添加一个options值，用来做选项
    formArray.forEach((item) => {
        if (item.type === 2 || item.type === 3) {
            //单选、多选
            let arr = item.optn.split(",");
            item.options = [];
            arr.forEach((items, idx) => {
                let arrs = items.split("-");
                item.options[idx] = { label: Number(arrs[0]), content: arrs[1] };
            });
        } else if (item.type === 4) {
            //下拉列表
            let arr = item.optn.split(",");
            item.options = [];
            arr.forEach((items, idx) => {
                let arrs = items.split("-");
                item.options[idx] = { value: arrs[0], label: arrs[1] };
            });
        }
    });
}